package num104;

/**
 * @author : DuJiabao
 * @Date : 2021/2/6 22:09
 * @Project : sword-finger-offer
 * @File : null.java
 * @Desc :给定一个二叉树，找出其最大深度。
 * https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/
 */
class Solution {
  public int maxDepth(TreeNode root) {
    if (root == null) return 0;
    return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
  }
}
